import request from '@/utils/request'

// 查询机构列表
export function listOrg(query) {
  return request({
    url: '/resource/packageOrg/list',
    method: 'get',
    params: query
  })
}

// 查询机构详细
export function getOrg(packageId) {
  return request({
    url: '/resource/packageOrg/' + packageId,
    method: 'get'
  })
}

// 获取地域信息
export function getAreaList(query) {
  return request({
    url: '/system/area/arealist',
    method: 'get',
    params: query
  })
}

// 新增机构
export function addOrg(data) {
  return request({
    url: '/resource/packageOrg',
    method: 'post',
    data: data
  })
}

// 修改机构
export function updateOrg(data) {
  return request({
    url: '/system/org',
    method: 'put',
    data: data
  })
}

// 删除机构
export function delOrg(orgId) {
  return request({
    url: '/resource/packageOrg/delete/' + orgId,
    method: 'delete'
  })
}

// 查询资质列表
export function getPackageOrgList(query) {
    return request({
      url: '/resource/packageOrg/qualify/list',
      method: 'get',
      params: query
    })
  }

  // 保存资质列表
  export function addPackageOrgList(data) {
    return request({
      url: '/resource/packageOrg/qualify',
      method: 'post',
      data: data
    })
  }

  // 删除资质列表
  export function delPackageOrgList(certificateIds) {
    return request({
      url: '/resource/packageOrg/qualify/delete/' + certificateIds,
      method: 'delete'
    })
  }

  // 回显资质列表
  export function editPackageOrgList(certificateId) {
    return request({
      url: '/resource/packageOrg/qualify/' + certificateId,
      method: 'get'
    })
  }